# PYTHON KOODI JOKA TEKEE ITSE TUNNISTUKSEN
toolbox.set_generate_word_graph(0)
toolbox.set_keep_state_segmentation(0);
toolbox.lna_open(lna_path, 1024)
toolbox.reset(0)
toolbox.set_end(-1)

while toolbox.run():
    pass

# We have to open with only "w" first, and then later with "r"
# for reading, or the file will not be written.
lmh_file = open(lmh_path, 'w')
toolbox.print_best_lm_history_to_file(lmh_file)
lmh_file.close()

lmh_file = open(lmh_path, 'r')
recognition = lmh_file.read()
lmh_file.close()

recognition = recognition.replace('<s>', '')
recognition = recognition.replace('</s>', '')
recognition = recognition.strip() 




